<?php $user_role = $this->session->userdata('admin_role'); ?>
<div id="content">
    <div id="title_content">Khách hàng <span style="font-weight:bold; font-style: italic;"><?php echo $khach_hang->ten_khach_hang; ?></span></div>
    <?php if ($this->session->flashdata('error')): ?>
        <div class="affiche_erreur">
            <?php echo $this->session->flashdata('error'); ?>
        </div>
    <?php endif; ?>


    <style>
        .customer_infor {
            border: 1px solid black;
            height:280px;
            margin-bottom: 20px;
            width: 300px;
        }

        .customer_infor .post_number {
            padding-left: 10px;
            background: #8f8a7f;
            height: 20px;
            color: #ffffff;
            font-size: 16px;
        }

        .customer_infor .post_content {
            margin-left: 10px;
        }

        .customer_infor .post_content ul li{
            float:none !important;
        }

        .customer_infor .post_content ul li span.label{
            margin-right: 10px;
            font-family: Arial, sans-serif;
            font-weight: bold;
            color: #222222;

        }


    </style>


    <div class="customer_infor">

        <div class="post_number">Thông tin khách hàng</div>
        <div class="post_content">
            <ul>
                <li>
                    <span class="label">Họ tên :</span>
                    <span class="value"><?php echo $khach_hang->ten_khach_hang; ?></span>
                </li>
                <li>
                    <span class="label">Công ty :</span>
                    <span class="value"><?php echo $khach_hang->ten_cong_ty; ?></span>
                </li>
                <li>
                    <span class="label">Điện thoại :</span>
                    <span class="value"><?php echo $khach_hang->dien_thoai; ?></span>
                </li>
                <li>
                    <span class="label">Email :</span>
                    <span class="value"><?php echo $khach_hang->email; ?></span>
                </li>
                <li>
                    <span class="label">Địa chỉ :</span>
                    <span class="value"><?php echo $khach_hang->dia_chi; ?></span>
                </li>

                <?php if ($user_role == '1'): ?>
                    <li>
                        <a href="<?php echo site_url('khach_hang/sua_thong_tin/') . '/' . $khach_hang->id; ?>">Sửa thông tin</a>
                    </li>
                <?php endif; ?>
            </ul>
        </div>
    </div>
    <!-- End .customer_infor -->

    <style>
        .wrapper_pay_infor {
            margin-bottom: 10px;

        }

        .wrapper_pay_infor h1{
            border-bottom: 1px solid #C8C8C8;
            color: #C8C8C8;
            font-size: 24px;
            margin: 20px 0;
        }


        .pay_infor_content_item h2{
            font-family: Arial, sans-serif;
            font-weight: normal;
            background: #8f8a7f;
            color: #ffffff;
        }

        .pay_infor_content_item{
            float:left;
            width: 280px;
            border: 1px solid black;
        }

        .pay_infor_content_item ul li{
            float:none !important;
        }

        .pay_infor_content_item ul li span.label {
            margin-right: 10px;
            font-weight: bold;
        }

        .pay_infor_content_item ul li span.no_pay {
            color: red;
        }

        .pay_infor_content_item ul li span.pay {
            color: green;
        }
        
        .not_pay {
            color: red;
        }

        .pay {
            color: green;
        }


    </style>

    <div class="wrapper_pay_infor">
        <h1>
            Dịch vụ đang sử dụng
        </h1>

        <table class="list" width="100%">
            <thead>
                <tr>

                    <th>Tên dịch vụ </th>
                    <th>Tên Website</th>
                    <th>Ngày bắt đầu</th>
                    <th>Ngày kết thúc</th>
                    <th>Số tiền</th>

                    <th>Tình trạng thanh toán</th>
                    <th>Thông tin thanh toán</th>

                    <?php if ($user_role == '1'): ?>
                        <th colspan="2">Action</th>
                    <?php endif; ?>
                </tr>
            </thead>
            <tbody>
                <?php
                if (isset($data) && !empty($data)):
                    foreach ($data as $aRow):
                        ?>
                        <tr>
                            <td><?php echo $aRow['ten_dich_vu']; ?></td>
                            <td><?php echo $aRow['ten_website']; ?></td>
                            <td><?php echo date('d/m/Y', $aRow['ngay_bat_dau']); ?></td>
                            <td><?php echo date('d/m/Y', $aRow['ngay_ket_thuc']); ?></td>
                            <td><?php echo $aRow['so_tien']; ?></td>
                            <td>
                                <?php if ($aRow['tinh_trang'] != 1) { ?>
                                <a class="not_pay" href="<?php echo site_url('thanh_toan/doi_trang_thai/').'/'.$aRow['thanh_toan_id'].'/'.$kh_id;?>">Chưa thanh toán</a>
                                    <?php } else {
                                    ?>
                                    <a class="pay" href="<?php echo site_url('thanh_toan/doi_trang_thai/').'/'.$aRow['thanh_toan_id'].'/'.$kh_id;?>">Đã thanh toán</a>
                                <?php }
                                ?>
                            </td>
                            <td><a href="<?php echo site_url('thanh_toan/thanh_toan_dich_vu') . '/' . $aRow['dich_vu_id']; ?>">Thông tin thanh toán</a></td>
                            <?php if ($user_role == '1'): ?>
                                <td width="30px"><a href="<?php echo site_url('dich_vu/sua_thong_tin/' . $aRow['dich_vu_id']) ?>" title="Sửa"><img src="<?php echo base_url() ?>assets/admin/images/modifier.png" alt="modifier"/></a></td>
                                <td width="30px"><a class="confirm_delete" href="<?php echo site_url('dich_vu/xoa_thong_tin/' . $aRow['dich_vu_id']) ?>"><img src="<?php echo base_url() ?>assets/admin/images/supprimer.png" alt="supprimer"/></a></td>
                                    <?php endif; ?>
                        </tr>
                    <?php endforeach; ?>
                <?php endif; ?>
            </tbody>
        </table>

    </div><!-- End .wrapper_pay_infor -->





</div>
<!--END content-->
